package com.colin.controller;

import com.colin.pojo.ChanPian;
import com.colin.service.ChanPinService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("chanpin")
public class ChanPinController {
    @Autowired
    ChanPinService chanPinService;
    @RequestMapping("insert")
    public String insert (ChanPian chanPian) {
        chanPinService.insert(chanPian);
        return "forward:/web/tiaoZhuan3";
    }
    @RequestMapping("delete")
    public String delete (Integer id) {
        chanPinService.delete(id);
        return "forward:/web/tiaoZhuan3";
    }
}
